Configure SNMP settings

Configure Simple Network Management Protocol (SNMP) to define or modify the SNMP settings, and specify the security level for SNMP communications.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Enable the generation of authentication traps:

    snmp-server authentication-trap enable

  3. Configure the contact information for the system:

    snmp-server contact WORD<0-255>

  4. Create an SNMPv1 server host:

    snmp-server host WORD<1-256> [port <1-65535>] v1 WORD<1-32> [filter WORD<1-32>]

  5. Create an SNMPv2 server host:

    snmp-server host WORD<1-256> [port <1-65535>] v2c WORD<1-32> [inform] [timeout <1-2147483647>][retries <0-255>][mms <0-2147483647>]] [filter WORD<1-32>]

  6. Create an SNMPv3 server host:

    snmp-server host WORD<1-256> [port <1-65535>] v3 {noAuthNoPriv|authNoPriv|authPriv WORD<1-32> [inform] [timeout <1-2147483647>][retries <0-255>]] [filter WORD<1-32>]

  7. Configure the system location:

    snmp-server location WORD<0-255>

  8. Enable login-success traps:

    snmp-server login-success-trap enable

  9. Configure the SNMP system name:

    snmp-server name WORD<0-255>

  10. Create a new entry in the notify filter table:

    snmp-server notify-filter WORD<1-32> WORD<1-32>

Example

Enable the generation of SNMP traps. Configure the contact information for the system. Configure hosts to receive SNMP notifications:

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#snmp-server authentication-trap enable
Switch:1(config)#snmp-server contact xxxx@company.com
Switch:1(config)#snmp-server host 192.0.2.16 port 1 v1 SNMPv1 filter SNMPfilterv1

Variable Definitions

The following table defines parameters for the snmp-server command.

Variable

Value

authentication-trap {enable}

Enables generation of SNMP server authentication traps.

contact WORD<0-255>

Changes the sysContact information for the switch. WORD<0-255> is an ASCII string from 0–255 characters (for example, a phone extension or email address).

host WORD<1-256> [port <1-65535>] {v1 WORD<1-32>|v2c WORD<1-32> [inform] [timeout <1-2147483647>][retries <0-255>][mms <0-2147483647>]]|v3 {noAuthPriv|authNoPriv|authPriv} WORD<1-32> [inform [timeout <1-2147483647>][retries <0-255>]]} [filter WORD<1-32>]

Configures hosts to receive SNMP notifications.
  • host WORD<1-256> specifies the IPv4 or IPv6 host address

  • port <1-65535> specifies the port number

  • v1 WORD<1-32> specifies the SNMPv1 security name

  • v2c WORD<1-32> specifies the SNMPv2 security name

  • inform specifies the notify type

  • timeout <1-2147483647> specifies the timeout value

  • retries <0-255> specifies the number of retries

  • mms < 1-2147483647> specifies the maximum message size

  • v3 specifies SNMPv3

  • noAuthPriv|authNoPriv|authPriv specifies the security level

  • WORD<1-32> specifies the user name

  • filter specifies a filter profile name

location WORD<0-255>

Configures the sysLocation information for the system. <WORD 0-255> is an ASCII string from 0–255 characters.

login-success-trap {enable}

Enables generation of SNMP server login-success traps.

name WORD<0-255>

Configures the sysName information for the system. <WORD 0-255> is an ASCII string from 0–255 characters. SNMP system name is derived from the global system name that is synchronized with SNMP system name, until the SNMP system name is manually configured.

notify-filter WORD<1-32> WORD<1-32>

Creates a new entry in the notify filter table. The first WORD<1-32> specifies the filter profile name, and the second WORD<1-32> specifies the subtree object identifier (OID).